/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaes.controlador;

import java.util.List;
import javaes.dados.endereco.EnderecoDAO;
import javaes.dados.endereco.EnderecoDAOHibernate;
import javaes.modelo.Endereco;

/**
 *
 * @author yoda
 */
public class EnderecoRN implements IEnderecoRN
{
    private EnderecoDAO enderecoDAO;

    public EnderecoRN()
    {
        this.enderecoDAO = new EnderecoDAOHibernate();
    }
    
    @Override
    public void salvar(Endereco endereco) throws Exception 
    {
        this.enderecoDAO.salvar(endereco);
    }

    @Override
    public void excluir(Endereco endereco) throws Exception 
    {
        this.enderecoDAO.excluir(endereco);
    }

    @Override
    public List<Endereco> listar() throws Exception 
    {
        return this.enderecoDAO.listar();
    }

    @Override
    public Endereco buscaPorID(long id) throws Exception 
    {
        return this.enderecoDAO.buscaPorID(id);
    }
    
}
